<?php $Usuario = Dracosys::getLoggedUser(); ?>
<h2>Contra Cheque</h2>
<section id="CheckAgainst">
    <table id="PaymentControl_user" class="list">
        <thead>
            <tr>
                <th>Periodo</th>
                <th>Dia do Pagamento</th>
                <th>Total Recebido</th>
                <th>Visualizar</th>
            </tr>
        </thead>
        <tfoot>
        </tfoot>
        <tbody>
            <?php
            if( $Usuario->hasPayments() ):
                foreach($Usuario->getArPagamentos() as $Payment): ?>
                    <tr>
                        <td><?=$Payment->getStPeriodo()?></td>
                        <td><?=dateBDtoBR($Payment->getDtDiaPagamento())?></td>
                        <td><?=MathUtils::money($Payment->getReceivedTotal())?></td>
                        <td>
                            <a href="<?=DRA_URL?>pagamento/visualizar-pagamento/pagamento/<?=$Payment->getIDPagamento()?>" title="Visualizar">
                                <img src="<?= DRA_VIEW_URL ?>images/descricao.png" alt="Visualizar" />
                            </a>
                        </td>
                    </tr>
            <?php
                endforeach;
            else:
            ?>
                <tr class="nodata">
                    <td colspan="4">
                        Nenhum resultado foi encontrado!
                    </td>
                </tr>
            <?php
            endif;
            ?>
        </tbody>
    </table>
</section>